import cv2
# 导入第一张照片

path = 'huangdi1.jpg'
img1 = cv2.imread(path)
img1 = cv2.resize(img1,(400,400))
# 导入第二张照片

path2 = 'huangdi2.jpg'
img2 = cv2.imread(path2)
img2 = cv2.resize(img2,(100,100))
# 确定第二张照片的位置
x_start ,y_start = 50,50
x_end , y_end = x_start + img2.shape[1],y_start + img2.shape[0]
# 放置img2到img1上
img1 [y_start:y_end, x_start:x_end] = img2
# img[y_start:y_end, x_start:x_end] = img2
cv2.imshow('img',img1)
cv2.waitKey(0)
cv2.destroyWindow()












